package com.yl.core.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;

@Slf4j
public class MyApplicationReadyListener implements ApplicationListener<ApplicationReadyEvent> {

    /**
     * springboot加载完成时候执行的事件
     * @param event
     */
    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        //log.error("springboot加载完成时候执行的事件【ApplicationReadyEvent】");
        System.out.println("ApplicationReadyEvent事件发布：" + event.getTimestamp());
    }
}
